<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!--这个就是运行后第一次打开的页面 用作 登录界面 放在了WEB-INF外面-->
<%@ include file="/login/page/include/taglib.jsp" %>
<%--/login/page/include/taglib.jsp--%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="layui/css/layui.css" media="all">

    <link rel="stylesheet" href="css/style.css">

    <script>
        var ctx = "${ctx}";  //因为下面引入的login.js中会用到ctx变量
    </script>

    <title>登录</title>

   <style type="text/css">

     #bg_img {
         position: absolute;
         width: 100%;
         height: 100%;
     }

     #promotion{
         float: left;
         position: absolute;
         left: 25%;
         top: 27%;
         background: url(${ctx}/image/1.png);
         font-family: KaiTi;
         font-size: 450%;
         align-content: center;
     }
   </style>
</head>

<body>
    <img src="image/back_061.jpg" id="bg_img">

    <a href="/promotion/promotionList" id="promotion">点击查看医院公告</a>

    <div class="login-main">

        <header class="layui-elip">用户登录</header>

        <form class="layui-form" lay-filter="login">
            <input type="hidden" name="opr" value="login">

        <div class="layui-input-inline">
            <input id="hzName" name="hzName" type="text" placeholder="用户名" class="layui-input">
        </div>
            <div class="layui-input-inline">
                <input id="hzPwd" name="hzPwd" type="password" placeholder="密码" class="layui-input">
            </div>
        <div class="layui-btn layui-btn-radius" style="margin-left: 5px"><%--layui-input-inline--%>
            <button type="button" class="layui-btn" onclick="loginByPwd();">登录</button>

        </div>
        <button type="button" class="layui-btn layui-btn-radius layui-btn-warm" style="margin-left: 60px;width: 35%;">
            <a href="register.jsp">注册</a>
        </button>
        </form>

    </div>

    <script type="text/javascript" src="layui/layui.js"></script>
    <script type="text/javascript" src="js/login.js"></script>
    <script type="text/javascript" src="js/pubilc.js"></script>
</body>
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script>
    function loginByPwd(){
        $.getJSON("/login.do",$("form").serializeArray(),function(result){
            if(result != null){
                alert("登录成功！")
                window.location.href = "../index.jsp";
            }else{
                alert("登录失败！")
            }
        })
    }
</script>
</html>






